package com.briup.day17;

import jdk.internal.util.xml.impl.Input;

import java.io.FileInputStream;
import java.io.InputStream;

/**
 * @author lining
 * @date 2024/1/29 10:15
 */
public class TestFileInputStream2 {
    public static void main(String[] args) throws Exception{
        //1.声明流
        InputStream in = null;
        //2.创建子类对象
        in = new FileInputStream("a.txt");
        //3.读操作(读取所有字节信息)
        int data = -1; //默认流的末尾
        while((data = in.read()) != -1){
           System.out.println(data);
        }
        //4.关闭流 释放资源
        if(in != null) in.close();
    }
}
